import request from "@/utils/request";
//项目用户相关的请求地址
const API = {
    SAVE_CUSTOMER: '/customer',
    DEL_CUSTOMER_BY_ID: '/customer',
    UPDATE_CUSTOMER: '/customer',
    PAGE_CUSTOMER: '/customer/page',
    DISABLE_CUSTOMER: '/customer/ban',
    LIST_CUSTOMER_NAME: '/customer/list/name',
}

//新增客户接口
export const reqSaveCustomer = (requestParam) => request.post(API.SAVE_CUSTOMER, requestParam)

//删除客户接口
export const reqDeleteCustomerById = (id) => request.delete(API.DEL_CUSTOMER_BY_ID, { params: { id } });

//更新客户信息接口
export const reqUpdateCustomer = (requestParam) => request.put(API.UPDATE_CUSTOMER, requestParam)

//禁用 | 启用
export const reqDisableOrEnableCustomer = (id, banFlag) => request.put(API.DISABLE_CUSTOMER, null, { params: { id, banFlag}})
//分页查询客户接口
export const reqPageCustomer = (pn, ps, clerkId = null, realName = null) =>
    request.get(API.PAGE_CUSTOMER, {params: { pn, ps, clerkId, realName}})

//查询客户名接口
export const reqNameList = () => request.get(API.LIST_CUSTOMER_NAME)
